home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-04-06 | 1.2 KB | 40 lines | [TEXT/MMCC] |
- #include "core.h"
- #include "view.h"
- #include "cube.h"
- #include "bsptree_3d.h"
- #include "transform_3d.h"
-
- bsptree *world;
- void main (void)
- {
- core_main ();
- }
-
- void InitializeApplication (void)
- {
- // make the scene to display
- world = new bsptree;
- world->Insert (Cube (IDENTITY_MATRIX), OUT, OUT);
- world->Insert (Cube (Scale (R(-1.0), R(-0.75), R(-1.25)) * Translate (R(0.25), R(0.0), R(0.0))), IN, OUT);
- world->Reduce ();
- world->Insert (Cube (Scale (R(0.5), R(0.75), R(0.5)) * RotateY (R(15.0)) * Translate (R(0.25), R(0.75), R(0.0))), OUT, OUT);
- world->Reduce ();
-
- // make the display window
- window *w = new window (2000, 0);
- w->SetAspectRatio (1, 1);
- Rect c1 = {kTop, kLeft, kBottom, kRight}, c2 = {0, 0, 0, 0},
- c3 = {kTop, kLeft, kTop, kLeft}, c4 = {7, 7, 103, 63},
- c7 = {kTop, kLeft, kBottom, kRight}, c8 = {20, 20, -20, -20},
- c9 = {kTop, kLeft, kBottom, kRight}, c10 = {1, 1, -1, -1},
- b1 = {10, 10, 30, 60}, b2 = {32, 10, 52, 60},
- b3 = {54, 10, 76, 60}, b4 = {78, 10, 100, 60};
- bound3d *b = new bound3d (c1, c2),
- *gbound3 = new bound3d (c7, c8, FALSE);
- bound *gbound = new bound (c9, c10);
- view *vw = new view (w);
- gbound->AddChild (vw);
- gbound3->AddChild (gbound);
- b->AddChild (gbound3);
- w->AddChild (b);
- }